package com.zzn.bookManage.pojo;

import java.util.Arrays;
import java.util.List;

public class ResultEntity<T> {
    int page; // 所在页数
    int row;  // 每页数量
    int count;// 总数
    int records;// 页数
    List<T> data; // 返回数据

    public ResultEntity() {
    }

    @Override
    public String toString() {
        return "ResultEntity{" +
                "page=" + page +
                ", row=" + row +
                ", count=" + count +
                ", total=" + records +
                ", data=" + Arrays.toString(data.toArray()) +
                '}';
    }

    public boolean hasData(){
        return data!=null && data.size()>0;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getRecords() {
        return records;
    }

    public void setRecords(int records) {
        this.records = records;
    }
}
